package com.cncytech.uiautomator_demo.testcase;

import com.cncytech.uiautomator_demo.BaseTest;
import com.cncytech.uiautomator_demo.RetryWatcher;
import com.cncytech.uiautomator_demo.TestConstant;
import com.cncytech.uiautomator_demo.utils.Describe;

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.*;

import org.junit.Rule;
import org.junit.Test;

public class SmsPoliciesTest extends BaseTest {

    @Rule
    public RetryWatcher retryWatcher = new RetryWatcher(TestConstant.retryCount);

    @Test
    @Describe(TestConstant.SMS_FORBIDDEN)
    public void smsForbiddenTest() {
        String msg = TestConstant.SMS_FORBIDDEN + TestConstant.FAILURE;
        int status = 0;
        assertThat(msg, tm.setSmsPolicies(status, ""));
        int smsPolicies = tm.getSmsPolicies();
        assertThat(msg, smsPolicies, is(status));
    }

    @Test
    @Describe(TestConstant.SMS_ENABLE)
    public void smsEnableTest() {
        String msg = TestConstant.SMS_ENABLE + TestConstant.FAILURE;
        int status = 0;
        assertThat(msg, tm.setSmsPolicies(status, ""));
        int smsPolicies = tm.getSmsPolicies();
        assertThat(msg, smsPolicies, is(status));
    }
}
